(function(e){
 for(var _obj=document.getElementById(e.id).getElementsByTagName(e.tag),i=-1,em;em=_obj[++i];){
  em.onclick = function(){ //onmouseover
   var ul = this.nextSibling;
   if(!ul){return false;}
   ul = ul.nextSibling; if(!ul){return false;} 
   if(e.tag != 'a'){ ul = ul.nextSibling; if(!ul){return false;} } 
   for(var _li=this.parentNode.parentNode.childNodes,n=-1,li;li=_li[++n];){
    if(li.tagName=="LI"){
     for(var _ul=li.childNodes,t=-1,$ul;$ul=_ul[++t];){
      switch($ul.tagName){
      case "UL":
       $ul.className = $ul!=ul?"" : ul.className?"":"off";
      break;
      case "EM":
       $ul.className = $ul!=this?"" : this.className?"":"off";
      break;
      }
     }
    }
   }
  }
 }
})({id:'menu',tag:'em'});